package com.wk.paradise.redis.utils;

import com.wk.paradise.redis.config.redisConfig.RedisPool;
import redis.clients.jedis.Jedis;

/**
 * @Classname RedisStringUtil
 * @Description TODO
 * @Date 2019/12/23 9:34
 * @Author by weikai
 */
public class RedisStringUtil {

  public static void set(RedisPool pool,String key,String value){

    Jedis jedis = pool.getResource();
    try{
      jedis.set(key,value);
    }finally {
      jedis.close();
    }
  }

  public static String get(RedisPool pool,String key){

    Jedis jedis = pool.getResource();
    try{
      return jedis.get(key);
    }finally {
      jedis.close();
    }
  }

}
